<?php

namespace app\common\model;

use think\Model;

/**
 * 数据层模型
 */
class Fuskill extends Model {

    /**
     * 查找
     */
    public function getList($condition=[],$field='*',$page=0,$order='id desc')
    {
        if ($page)
        {
            $res = db('fuwu_skill')->where($condition)->field($field)->order($order)->paginate($page,false,['query'=>request()->param()]);
            $this->page_info=$res;
            return $res->items();
        }else{
            return db('fuwu_skill')->where($condition)->field($field)->order($order)->select();
        }
    }

    /**
     * 添加
     */
    public function  add($data)
    {
        return db('fuwu_skill')->insertGetId($data);
    }

    /**
     * 修改
     */
    public function edit($condition=[],$data)
    {
        return db('fuwu_skill')->where($condition)->update($data);
    }

    /**
     * 删除
     */
    public function del($condition=[])
    {
        return db('fuwu_skill')->where($condition)->delete();
    }

    /**
     * 获取单个详情
     */
    public function info($condition=[],$field='*')
    {
        return db('fuwu_skill')->where($condition)->field($field)->find();
    }
}
?>
